package cn.outsourcing.supermarket.common.enums;

import cn.outsourcing.supermarket.common.constants.CommonConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 返回结果枚举类
 *
 * @author gzkemays
 * @since 2021/10/15 20:15
 */
@Getter
@AllArgsConstructor
public enum ResultEnums {
  /** 当请求成功时 */
  OK(CommonConstants.REQUEST_SUCCESS_CODE, "请求成功"),
  /** 当请求失败时 */
  FAIL(CommonConstants.REQUEST_FAIL_CODE, "请求失败"),
  HTTP_REQ_NOT_SUPPORTED(CommonConstants.REQUEST_FAIL_CODE + 1, "请求类型错误"),
  DATA_ERROR(CommonConstants.REQUEST_FAIL_CODE + 2, "请求数据异常"),
  REQ_ERROR_SUPPORT(CommonConstants.REQUEST_FAIL_CODE + 3, "HTTP请求异常"),
  IMAGE_FAIL(CommonConstants.REQUEST_FAIL_CODE + 4, "上传图片失败"),
  SQL_ERROR(CommonConstants.SQL_FAIL_CODE, "数据库异常"),
  SQL_OPERA_ERROR(CommonConstants.SQL_FAIL_CODE + 1, "数据库操作异常"),
  UNKNOWN_ERROR(CommonConstants.UNKNOWN_ERROR_CODE, "未知异常"),
  NULL_POINTER_ERROR(CommonConstants.INTERNAL_SERVER_ERROR_CODE+1,"空指针异常"),
  ILLEGAL_ARGS_ERROR(CommonConstants.INTERNAL_SERVER_ERROR_CODE+2,"参数异常"),
  SECURITY_PWD_ERROR(CommonConstants.SECURITY_ERROR_CODE, "security加密异常");
  int code;
  String msg;
}
